/**
 * 
 */
package fr.rcp.file.explorer.views;

import org.eclipse.jface.action.ControlContribution;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

import fr.rcp.file.explorer.controleur.Controleur;

/**
 * @author fred
 * 
 */
public class BrowserUrl extends ControlContribution {
	private Combo combo;

	protected BrowserUrl(String label) {
		super(label);
	}

	@Override
	protected Control createControl(Composite parent) {
		combo = new Combo(parent, SWT.DROP_DOWN | SWT.SIMPLE | SWT.FILL);
		combo.setLayoutData(new GridData(SWT.FILL, SWT.RIGHT, true, false));
		combo.add("C:\\\\");
		combo.add("D:\\\\");
		combo.add("                                                            ");
		combo.setTextLimit(1000);
		combo.select(0);
		combo.addModifyListener(Controleur.getIntance());
		return combo;
	}

	public void setValue(int index) {
		combo.select(index);
	}

}
